<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app"></div>
    <button id="btn">点击建立socket连接</button>
</body>

</html>
<style>
    svg {
        stroke: hotpink;
        width: 100px !important
    }
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script>
<script>
    btn.onclick = function () {
        var socket = io("ws://chst.vip")
        socket.on('connect', () => {
            console.log('链接成功')

        })
        socket.on("wepaySuccess", data => {
            console.log(data);
        })
        socket.on("wepayFail", data => {
            console.log(data);
        })
        // fetch("http://chst.vip/users/getScancode")
        //     .then(res => res.json())
        //     .then(res => {
        //         console.log(res);
        //     })
        // socket.on('scancodeSuccess', (data) => {
        //     console.log(data)
        // })
        // socket.on('qrcode', (data) => {
        //     console.log(data)
        // })
        // socket.on('wechatLoginSuccess', (data) => {
        //     console.log(data)
        // })

    }
</script>